package cn.kn.sys.controller;

import cn.kn.common.model.PageBean;
import cn.kn.common.model.R;
import cn.kn.sys.service.UserServic;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WangJiang
 * @create 2020-12-12 13:49
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("sys/user")
public class UserController {

    private final UserServic userServic;


    @GetMapping
    public R list(String userName, PageBean pageBean){
        return userServic.list(userName,pageBean);
    }


    @GetMapping("login")
    public R login(@RequestParam String username, @RequestParam String password){
        return userServic.login(username,password);
    }
}
